package com.yc;

import dev.langchain4j.model.chat.ChatModel;
import dev.langchain4j.model.openai.OpenAiChatModel;
import dev.langchain4j.service.AiServiceContext;
import dev.langchain4j.service.AiServices;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;

/**
 * @description:
 * @author yw
 */
public class _05_PromeptTemplate {
    public static void main(String[] args) {
        String apiKey=System.getenv("DEEPSEEK_API_KEY");
        OpenAiChatModel model = OpenAiChatModel.builder()
                .apiKey(apiKey)
                .modelName("deepseek-chat")
                .baseUrl("https://api.deepseek.com")
                .logRequests(true)
                .logResponses(true)
                .build();
        Assistant assistant = AiServices.create(Assistant.class, model);
        String response = assistant.chat("你好，什么是systemmessage,什么是usermessage?有什么区别");
        System.out.println(response);
    }
}
interface Assistant {
    @SystemMessage("你是一位大模型专家，你会用非常专业的语言回答用户的问题。")
    @UserMessage("我给你新的问题:${it}")
    String chat(String userMessage);
}